package com.mlz.mlzmall.custom.circleimageview;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * Created by Administrator on 2016/5/6.
 */
public class BaseImageView extends ImageView {
    private ScaleType SCALE_TYPE = ScaleType.CENTER;
    private boolean mReady;
    private boolean mSetupPending;


    public BaseImageView(Context context) {
        super(context);
    }

    public BaseImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public BaseImageView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);


    }

    private void init() {
        super.setScaleType(SCALE_TYPE);
        mReady = true;

        if (mSetupPending) {
//            setup();
            mSetupPending = false;
        }
    }
    @Override
    public ScaleType getScaleType() {
        return SCALE_TYPE;
    }

    @Override
    public void setScaleType(ScaleType scaleType) {
//		if (scaleType != SCALE_TYPE) {
//			throw new IllegalArgumentException(String.format("ScaleType %s not supported.", scaleType));
//		}
        this.SCALE_TYPE = scaleType;
    }
}
